package HP.p0814;

import java.util.Arrays;
import java.util.Scanner;

public class Text1 {
    public static void main(String[] args) {

        String[] name = new String[5];
        int[] score = new int[5];
        int num = 0;
        for (int i = 0; i < name.length; i++) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入第" + (i + 1) + "个同学的姓名:");
            name[i] = scanner.nextLine();
            System.out.println("请输入第" + (i + 1) + "个同学的成绩:");
            score[i] = scanner.nextInt();
            num += score[i];
        }

        for (int i = 0; i < name.length; i++) {
            System.out.println("第" + (i + 1) + "名同学的姓名是:" + name[i] + " " + "成绩是:" + score[i]);
        }
        System.out.println("平均分是:" + num / name.length);
        Arrays.sort(score);
        System.out.println(Arrays.toString(score));
        System.out.println("最高分:" + score[4] + "; 最低分:" + score[0]);
    }
}
